﻿using System.ComponentModel.DataAnnotations;

namespace MvcCart.Models
{
    public class Cart
    {
        public int Id { get; set; }

        [Required(ErrorMessage = "购物车id必填")]
        [Display(Name ="购物车id")]
        public int cartid { get; set; }

        [Required(ErrorMessage = "商品id必填")]
        [Display(Name = "商品id")]
        public int productid { get; set; }

        [Required(ErrorMessage = "商品数量必填")]
        [Display(Name ="商品数量")]
        public int productnum { get; set; }

        [Required(ErrorMessage = "商品总价必填")]
        [Display(Name = "商品总价")]
        public decimal price { get; set; }

        [Required(ErrorMessage ="用户id必填")]
        [Display(Name = "用户id")]
        public int userid { get; set; }

        [Required(ErrorMessage ="创建时间必填")]
        [Display(Name ="创建时间")]
        public DateTime createtime { get; set; }

    }
}
